Skip to content

ci: pin Build/Regression runner to ubuntu-24.04 and guard Bison version for GLR grammar#2445

Merged
jrgemignani merged 2 commits into
apache:masterfrom
gregfelice:ci/pin-bison-for-glr-grammar
Jul 2, 2026
Merged

ci: pin Build/Regression runner to ubuntu-24.04 and guard Bison version for GLR grammar#2445
jrgemignani merged 2 commits into
apache:masterfrom
gregfelice:ci/pin-bison-for-glr-grammar

Conversation

@gregfelice

@gregfelice gregfelice commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

What

Pin the Build / Regression CI runner image (installcheck.yaml) and guard the Bison version for the Cypher GLR grammar.

  • installcheck.yaml: runs-on: ubuntu-latestubuntu-24.04
  • Add a "Verify Bison version" step that fails with a clear, actionable message if Bison ever drifts off 3.8.x.

Why

src/backend/parser/cypher_gram.y pins exact conflict counts via %expect 7 / %expect-rr 3, and Bison treats %expect as exact-match (not a ceiling) — any deviation fails the build. ubuntu-latest floats to new Ubuntu releases, which can ship a different Bison version that reports different conflict counts, breaking the build with a cryptic grammar-generation error unrelated to the actual change.

Freezing the runner image freezes Bison at 3.8.x, so the pinned %expect counts stay reproducible. The version guard turns a future drift into an explicit, self-explanatory failure ("re-run bison, update %expect, and bump the pinned runner together") instead of a confusing one.

Reproducibility comes from pinning the variable rather than widening the conflict-count tolerance, keeping the exact-match alarm for genuinely new grammar conflicts intact. This mirrors PostgreSQL's own gram.y, which keeps an exact %expect and updates it on intentional changes.

Scope — intentionally only Build / Regression

Only installcheck.yaml builds the Cypher grammar with Bison, so it is the only workflow whose result depends on the Bison version. The four driver workflows (jdbc-driver.yaml, nodejs-driver.yaml, go-driver.yml, python-driver.yaml) run their drivers against the AGE Docker image and never invoke Bison — pinning them here would freeze their runner for no functional reason (and would collide with their own runtime pins, e.g. the Node version set in nodejs-driver.yaml). They are intentionally left on ubuntu-latest.

Testing

CI config only; no source or test changes. The existing Build / Regression workflow runs unchanged on the pinned image.

The Cypher GLR grammar pins exact shift/reduce and reduce/reduce conflict
counts via %expect / %expect-rr in cypher_gram.y, and Bison treats %expect
as exact-match: a different Bison version can report different counts and
break the build. ubuntu-latest floats to new Ubuntu releases (and new Bison
versions), which would silently shift those counts.

Pin runs-on to ubuntu-24.04 to freeze Bison at 3.8.x, and add a guard step
that fails loudly with a pointer to cypher_gram.y if Bison ever drifts off
3.8.x. Reproducibility comes from pinning the variable rather than widening
the conflict-count tolerance, keeping the exact-match alarm for genuinely
new grammar conflicts intact.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the CI environment more reproducible for the Cypher GLR grammar by pinning the GitHub Actions runner image and adding an explicit guard that fails early if the Bison version drifts from the expected 3.8.x series (which would change %expect/%expect-rr conflict counts and break grammar generation).

Changes:

  • Pin the workflow runner from ubuntu-latest to ubuntu-24.04 to avoid unexpected toolchain drift.
  • Add a “Verify Bison version” step that errors with an actionable message when Bison is not 3.8.x.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/installcheck.yaml Outdated
@jrgemignani

Copy link
Copy Markdown
Contributor

@gregfelice Please see Copilot review above.

Address Copilot review on apache#2445: the previous grep-based parse could
silently yield an empty version and fail with a confusing
'Bison  != 3.8.x' message. Parse the version field with awk and error
explicitly when it can't be determined.
@gregfelice

Copy link
Copy Markdown
Contributor Author

Thanks @jrgemignani — addressed the Copilot note in 71fe83e.

The version guard now parses the field with awk 'NR==1 {print $NF}' instead of the grep -oE regex, and errors explicitly when the version can't be determined (instead of falling through to the confusing Bison != 3.8.x message):

ver=$(bison --version | awk 'NR==1 {print $NF}')
if [ -z "$ver" ]; then
  echo "::error::Could not determine Bison version from 'bison --version'."
  exit 1
fi

Verified the parse against bison (GNU Bison) 3.8.23.8.2 and empty input → caught by the guard.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/installcheck.yaml
@jrgemignani

Copy link
Copy Markdown
Contributor

@gregfelice One last Copilot comment.

@jrgemignani

Copy link
Copy Markdown
Contributor

@gregfelice bump

@gregfelice gregfelice changed the title ci: pin runner to ubuntu-24.04 and guard Bison version for GLR grammar ci: pin Build/Regression runner to ubuntu-24.04 and guard Bison version for GLR grammar Jul 2, 2026
@gregfelice

Copy link
Copy Markdown
Contributor Author

@jrgemignani On the remaining Copilot note (the other workflows still on ubuntu-latest): that's intentional, and I've clarified it in the PR description under a new Scope section.

The pin exists only to freeze Bison so the GLR grammar's exact %expect/%expect-rr conflict counts stay reproducible — and installcheck.yaml (Build / Regression) is the only workflow that builds the grammar. The four driver workflows run their drivers against the AGE Docker image and never invoke Bison, so pinning them would freeze their runner for no functional reason (and would fight their own runtime pins, e.g. the Node version in nodejs-driver.yaml). So this PR narrows to Build / Regression by design rather than pinning all five.

Title/description updated to say so explicitly.

@jrgemignani jrgemignani merged commit c1617a2 into apache:master Jul 2, 2026
6 checks passed
@gregfelice gregfelice deleted the ci/pin-bison-for-glr-grammar branch July 2, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants